using Gameplay.PVE.Entity;

namespace Gameplay.PVE
{
    public class EnemyMeleeMoveBehaviour : EnemyMoveBehaviour
    {
         public override void Init(UnitBase unit, UnitRoadPath roadPath)
         {
             base.Init(unit, roadPath);
             if (roadPath is AStarRoadPath path)
             {
                 path.SetForceEndCondition(() => { return true; });
             }
         }
         
         protected override void UpdateGame()
         {
             base.UpdateGame();
             if (unit.Data.IsInSkill() || unit.Data.isInAction || unit.Data.isHiding || unit.Data.IsInAttack())
             {
                 if (unit.Data.moveState <= 2)
                 {
                     unit.Data.moveState = -1;
                 }
             }
             else
             {
                 unit.Data.moveState = 2;
             }
         }
    }
}